import { Injectable } from '@angular/core';
import { BaseService } from "../../../core/service/base.service";
import { _HttpClient } from "@delon/theme";
import { Observable } from "rxjs";
import { catchError, tap } from "rxjs/operators";

@Injectable({
  providedIn: 'root'
})
export class AccessClassService extends BaseService{

  getUrl(): string {
    return "api/sys-access-class";
  }

  constructor(http: _HttpClient) {
    super(http);
  }

  refresh(): Observable<any> {
    const url = `${this.getUrl()}/refresh`;
    return this.http.get<any>(url).pipe(
      tap((obj: any) => this.log(`refresh =${obj}`)),
      catchError(this.handleError<any>(`refresh`)),
    );
  }

}
